package com.jinhua.config;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * Copyright
 *
 * @Author WuHuang
 * @Date 2022/8/25
 */
@Data
public class PaginationRequest<T> implements Serializable {

    private static final long serialVersionUID = 8464277095850579474L;

    @Min(value = 1L, message = "pageNum大于1")
    @NotNull(message = "页码不能为空")
    @ApiModelProperty(notes = "当前页，从1开始", required = true)
    private Integer pageNum;
    @NotNull(message = "分页大小不能为空")
    @Min(value = 1L, message = "分页大小不小于1")
    @Max(value = 1000L, message = "分页大小不大于1000")
    @ApiModelProperty(notes = "分页大小", required = true)
    private Integer pageSize;
    @ApiModelProperty(notes = "查询条件")
    private T queryCriteria;

}
